package demo.restful2;

import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: jinshengyuan
 * Date: 2019-02-22
 * Time: 14:53
 * description:
 **/
public class server {
    public static void main(String[] args) {
        RoomService service = new RoomService();

        // Service instance
        JAXRSServerFactoryBean restServer = new JAXRSServerFactoryBean();
        restServer.setResourceClasses(Room.class,Person.class);
        List<Object> list = new ArrayList<>();
        list.add(service);
        restServer.setServiceBeans(list);
        restServer.setAddress("http://localhost:9999/");
        restServer.create();
    }
}
